import { createApp } from 'vue'
import App from './App.vue'

import '@/assets/main.css'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import 'element-plus/theme-chalk/dark/css-vars.css'

import Draggable from 'vuedraggable'

import index from './index'

const app = createApp(App)

app.use(ElementPlus, { locale: zhCn })

app.component('Draggable', Draggable)

app.use(index)

app.mount('#app')

// 隐藏加载动画
window.addEventListener('DOMContentLoaded', () => {
    const loading = document.getElementById('loading')
    const appEl = document.getElementById('app')
    if (loading && appEl) {
        loading.style.display = 'none'
        appEl.style.display = 'block'
    }
})